<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.org/ui">

    <h:form id="BookListListForm">

        <p:panel header="#{bundle.ListBookListTitle}">

            <p:dataTable id="datalist" value="#{bookListController.items}" var="item"
                         selectionMode="single" selection="#{bookListController.selected}"
                         rowKey="#{item.bookListPK}"
                         paginator="true"
                         rows="10"
                         rowsPerPageTemplate="10,20,30"
                         >

                <p:ajax event="rowSelect"   update="createButton viewButton editButton deleteButton"/>
                <p:ajax event="rowUnselect" update="createButton viewButton editButton deleteButton"/>

                <p:column sortBy="#{item.bookListPK.bookBorrowingStudentidStudent}" filterBy="#{item.bookListPK.bookBorrowingStudentidStudent}">
                    <f:facet name="header">
                        <h:outputText value="#{bundle.ListBookListTitle_bookListPK_bookBorrowingStudentidStudent}"/>
                    </f:facet>
                    <h:outputText value="#{item.bookListPK.bookBorrowingStudentidStudent}"/>
                </p:column>
                <p:column sortBy="#{item.bookListPK.idbookList}" filterBy="#{item.bookListPK.idbookList}">
                    <f:facet name="header">
                        <h:outputText value="#{bundle.ListBookListTitle_bookListPK_idbookList}"/>
                    </f:facet>
                    <h:outputText value="#{item.bookListPK.idbookList}"/>
                </p:column>
                <p:column sortBy="#{item.bookListPK.bookBorrowingEmployeeidEmployee}" filterBy="#{item.bookListPK.bookBorrowingEmployeeidEmployee}">
                    <f:facet name="header">
                        <h:outputText value="#{bundle.ListBookListTitle_bookListPK_bookBorrowingEmployeeidEmployee}"/>
                    </f:facet>
                    <h:outputText value="#{item.bookListPK.bookBorrowingEmployeeidEmployee}"/>
                </p:column>
                <p:column sortBy="#{item.book.name}" filterBy="#{item.book.name}">
                    <f:facet name="header">
                        <h:outputText value="#{bundle.ListBookListTitle_book}"/>
                    </f:facet>
                    <h:outputText value="#{item.book.name}"/>
                </p:column>
                <p:column sortBy="#{item.bookReceptionidbookReception.idbookReception}" filterBy="#{item.bookReceptionidbookReception.idbookReception}">
                    <f:facet name="header">
                        <h:outputText value="#{bundle.ListBookListTitle_bookReceptionidbookReception}"/>
                    </f:facet>
                    <h:outputText value="#{item.bookReceptionidbookReception.idbookReception}"/>
                </p:column>
                <p:column sortBy="#{item.bookBorrowing.idbookBorrowing}" filterBy="#{item.bookBorrowing.idbookBorrowing}">
                    <f:facet name="header">
                        <h:outputText value="#{bundle.ListBookListTitle_bookBorrowing}"/>
                    </f:facet>
                    <h:outputText value="#{item.bookBorrowing.idbookBorrowing}"/>
                </p:column>
                <f:facet name="footer">
                    <p:commandButton id="createButton" icon="ui-icon-plus"   value="#{bundle.Create}" actionListener="#{bookListController.prepareCreate}" update=":BookListCreateForm" oncomplete="BookListCreateDialog.show()"/>
                    <p:commandButton id="viewButton"   icon="ui-icon-search" value="#{bundle.View}" update=":BookListViewForm" oncomplete="BookListViewDialog.show()" disabled="#{empty bookListController.selected}"/>
                    <p:commandButton id="editButton"   icon="ui-icon-pencil" value="#{bundle.Edit}" update=":BookListEditForm" oncomplete="BookListEditDialog.show()" disabled="#{empty bookListController.selected}"/>
                    <p:commandButton id="deleteButton" icon="ui-icon-trash"  value="#{bundle.Delete}" actionListener="#{bookListController.delete}" update=":growl,datalist" disabled="#{empty bookListController.selected}"/>
                </f:facet>

            </p:dataTable>

        </p:panel>

    </h:form>

</ui:composition>